home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / Freeware / DiskMaster / Rexx / TTM-DM2LoadIcon.rexx < prev    next >
OS/2 REXX Batch file  |  2002-10-27  |  2KB  |  58 lines

  1. /* $VER: TTM-DM2LoadIcon.rexx 1.3 (2.10.98) by J. Tierney
  2.  
  3.   TTManager DiskMaster II Load Icon  v1.3
  4.   10/2/98  J. Tierney <jtierney@cyberlink-inc.com>
  5.  
  6.   Purpose:  Opens a new TTManager window for all selected files.
  7.  
  8.   Requires:  DiskMaster II,
  9.              TTManager - version 3.3d2 or above.
  10.  
  11.   DM2 Usage:  REXX TTM-DM2LoadIcon.rexx
  12. */
  13.  
  14. ttm = 'TTManager NOWARNINGS' /* Change this line to the path & options you use
  15.                                 for TTM, in case it isn't already running. */
  16.  
  17. OPTIONS RESULTS
  18.  
  19. who = ADDRESS()  /* Who ran this script?  DM.1, DM.2, DM.27? */
  20.  
  21. /* Start TTM if it isn't running. */
  22. IF ~SHOW('P', 'TTMANAGER') THEN DO
  23.  
  24.   ADDRESS COMMAND 'Run >NIL:' ttm
  25.   ADDRESS COMMAND 'SYS:RexxC/WaitForPort TTMANAGER'
  26.   IF rc ~= 0 THEN DO
  27.     MSG 'Unable to find TTManager''s port.'
  28.     EXIT 10
  29.   END
  30. END
  31.  
  32. /* Get the source window's dir. */
  33. STATUS P
  34. dir = result
  35. IF RIGHT(dir, 1) ~= ':' THEN dir = dir || '/'
  36.  
  37. /* Get selected files. */
  38. files = ''
  39. DIRLIST VAR dlist SEL
  40. DO i = 1 TO dlist.name.0
  41.   fname = '"' || dir || dlist.name.i || '"'
  42.   files = files fname
  43. END
  44.  
  45. IF files ~= '' THEN DO
  46.   ADDRESS 'TTMANAGER'  /* Hello, TTManager.                              */
  47.   'GETSCREEN'
  48.   scr = result         /* Store the screen TTM normally uses.            */
  49.   'SETSCREEN' who      /* Tell TTM to open it's window's on DM's screen. */
  50.   NEWWINDOW files      /* Tell TTM to open these files.                  */
  51.   'SETSCREEN' scr      /* Switch back to using the old screen.           */
  52.  
  53.   ADDRESS VALUE who    /* Let's talk to whichever DM called us. */
  54.   DESELECT '*'         /* Unselect the selected files.          */
  55.   SCREENTOFRONT        /* Hmmm, what could this do?             */
  56. END
  57.  
  58.